<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试Timer</title>
</head>
<body>
<script src="https://unpkg.com/@reactivex/rxjs@5.0.0-beta.7/dist/global/Rx.umd.js"></script>
<script>
	//这里指定一开始的delay时间
	//也可以输入一个Date，比如'2017-6-29 13:37:00'
	//这样变成了在指定的时间触发
	
	/*let source = Rx.Observable.timer(new Date('2017-6-29 13:37:00'));
	
	let subscription = source.subscribe(
		x=> console.log('Next:'+x),
		err=> console.log('Error:'+err),
		()=> console.log('Completed')
	)*/
	let source = Rx.Observable.timer(2000,1000)
	.take(3);
	
	let subscription = source.subscribe(
		x=> console.log('Next:'+x),
		err=> console.log('Error:'+err),
		()=> console.log('Completed')
	)
	
</script>
</body>
</html>